import React, { Component } from 'react'
import {
    Form,
    Table,
} from 'antd'
import styles from './index.less';
export class Tableb extends Component {
    state = {

    }


    // eslint-disable-next-line react/sort-comp
    onChangeA = (current) => { // 页数选择
        console.log(current)
        this.props.onSubmit({ current }) // 给父组件传值 实现更改数据
    }

     handleChange = (pagination, filters, sorter)=>{
        
    }

    // 每页显示多少条数据
    onShowSizeChangeA = (current, pageSize) => {
        console.log(current, pageSize);
        this.props.onSubmit({ current, pageSize }) // 给父组件传值 实现更改数据
    }

    render() {
        return (
            <div>
              <Table
                    style={{ padding:'0px 30px 0px 30px' }}
                    //  bordered
                    columns={this.props.columns1}
                    dataSource={this.props.dataSource1}//数据
                    onChange={this.handleChange}
                pagination={{  // 分页
                        // total: this.props.total1, // 数据总数量
                        pageSize: this.props.pageSize,  // 显示几条一页
                        defaultPageSize: this.props.page, // 默认显示几条一页
                        showSizeChanger: true,  // 是否显示可以设置几条一页的选项
                        showQuickJumper: true,
                        onChange: this.onChangeA,
                        onShowSizeChange: this.onShowSizeChangeA
                    }}

                />
            </div>
        )
    }
}

export default Form.create()(Tableb)
